class Player {
	//构造器
	constructor(list){
		this.list = list;
	}
	//es6 迭代器
	[Symbol.iterator](){
		let current = 0;
		let that = this;//将当前对象赋值（后续可能变化）
		return {
			next(){
				return current < that.list.length ? {value:that.list[current++], done:false} : {done:true};
			}
		};
	}
}

let player = new Player(['库里', '哈登', '威少']);
for(let tmp of player){
	console.log('name:',tmp);
}

//name: 库里
//name: 哈登
//name: 威少